<?php

class People_StreetController extends Base_Controller_Action
{

    public function indexAction()
    {
        //street list
        $dbTable = new Table_Street();
        $this->view->entries = $dbTable->view(array(), 'sid ASC');

    }
    
    public function createAction()
    {
        //create form
        $this->form = new Form_Street_Create();
        
        try {
            $this->create('street');
        }
        catch (Base_Model_Exception $e) {
            return $this->_helper->ErrorPage($e->getMessage());
        }
    }
    
    public function modifyAction()
    {   
        //create form
        $this->form = new Form_Street_Modify();
        
        try {
            $this->modify('street');
        }
        catch (Base_Exception $e) {
            return $this->_helper->ErrorPage($e->getMessage());
        }
    }
    
    public function deleteAction()
    {
        $this->form = new Form_Street_Delete();
        
        //drop post
        try {
            $this->delete('street');
        }
        catch (Base_Exception $e) {
            return $this->_helper->ErrorPage($e->getMessage());
        }
    }
}